<extend name="work/base"/>
<block name="content">
    <blockquote class="layui-elem-quote layui-quote-nm">预期工资=基础工资+制度奖金+绩效奖金*工作小时数+（签到奖金*4+出勤奖金)*21.75</blockquote>
    <table class="layui-table text-center" id="list" lay-filter="list" list-url="{:url('lists')}" edit-url="{:url('editform')}" ></table>
</block>

<block name="script">
    <script type="text/html" id="barDemo">
        <a class="layui-btn  layui-btn-xs " lay-event="edit"><i class="fa fa-pencil"></i> 编辑</a>
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delete"> <i class="fa fa-trash-o"></i> 删除</a>
    </script>
    <script type="text/javascript">
        layui.use(['element', 'table', 'form'], function () {
            var table = layui.table
                , form = layui.form;
            table.render({
                elem: '#list'
                , url: "{:Url('lists')}"
                , page: true
                , loading: true
                ,limit:20
                , cols: [[
                     {field: 'nickname', title: '用户姓名'}
                    , {field: 'base_wage', title: '基础工资+制度奖金',edit:'text',width:190,align:'right'}
                    , {field: 'work_wage', title: '绩效奖金',edit:'text',align:'right'}
                    , {field: 'base_time', title: '工作小时数',edit:'text',align:'right'}
                    , {field: 'login_wage', title: '签到奖金',edit:'text',align:'right'}
                    , {field: 'day_wage', title: '出勤奖金',edit:'text',align:'right'}
                    , {field: 'leave_wage', title: '事假补贴',edit:'text',align:'right'}
                    , {field: 'sick_wage', title: '病假补贴',edit:'text',align:'right'}
                    , {field: 'month_wage', title: '预期工资',align:'right'}
                ]]
            });
            form.on('submit(search_btn)', function (data) {
                table.reload('list', {
                    url: "{:Url('lists')}"
                    , page: {
                        curr: 1
                    }
                    , where: data.field
                });
                return false;
            });
            form.on('select(status)', function (data) {
                table.reload('list', {
                    url: "{:Url('lists')}"
                    , page: {
                        curr: 1
                    }
                    , where: {
                        status: data.value
                    }
                });
                return false;
            });
        });
    </script>
</block>
